Sequential tester for longest prefix search engines

ABSTRACT

The present invention is directed to a sequential tester for longest prefix search engines. The tester may include a longest prefix search engine, an inputs generator for providing a nearly random flow of input commands to the longest prefix search engine and for outputting a floating rectangle which may represent a search table of the longest prefix search engine, a coding module for providing address and prefix information to the longest prefix search engine, a mapping module for providing data information to the longest prefix search engine, a super search engine for performing super search operations, and an analyzer for computing predicted outputs of the longest prefix search engine and for comparing the predicted outputs with actual outputs computed by the longest prefix search engine.

CROSS-REFERENCE TO RELATED DOCUMENTS

The present application is a divisional application of U.S. patentapplication Ser. No. 10/387,988 filed on Mar. 13, 2003, pending. Thepresent application is also related to co-pending U.S. patentapplication Ser. No. 10/135,624, entitled “Built-in Functional Testerfor Search Engines”, filed Apr. 30, 2002, and to co-pending U.S. patentapplication Ser. No. 09/678,313, entitled “Fast Flexible Search Enginefor Longest Prefix Match”, filed Oct. 4, 2000. Said U.S. patentapplication Ser. Nos. 10/387,988, 10/135,624 and 09/678,313 are herebyincorporated by reference in their entireties.

FIELD OF THE INVENTION

The present invention generally relates to the field of search engines,and particularly to a sequential tester for longest prefix searchengines.

BACKGROUND OF THE INVENTION

The complexity encountered in designing integrated circuits (ICs)increases greatly as the functional count of the IC increases. Forexample, in synthesis practice of very large scale integration (VLSI)designs, verification and testing problems play a major role in thefinal stages of development and designing. Special difficulty may lie inthe testing of netlists and chips with complex sequential behavior, suchas those found in search engines of different natures. For instance,data communications are most often accomplished by sending a group ofdata in a packet, together with the address of the location for whichthe data are intended. A search for data may be accomplished byconducting a binary search based on the address or prefix where the dataare retained, or stored. The search may be conducted by a lookupprocedure that matches the query address with the stored address.Therefore, a search engine that enables the search of the data needs todemonstrate such capabilities in a manner consistent with thecontemplated usage of the search engine.

One of the practical methods to prove that search engines may functionwell in real chip practice is to perform their all-round verification bymeans of sequential testers that simulate actual usage of such searchengines.

Longest prefix search engines (LPSEs) may be more difficult forsimulation and testing than search engines for perfect match type,because for LPSEs one need simulate engine commands dealing with addressprefixes of an arbitrary length rather than addresses of a fixed length.Moreover, LPSEs require particular encoding/decoding of engine internalmemory, which may be significantly different from what is required forsearch engines for perfect match types.

Thus, it would be desirable to provide a sequential and functionaltester which may be employed for simulating and testing LPSEs.

SUMMARY OF THE INVENTION

Accordingly, the present invention is directed to a sequential testerfor LPSEs which may be employed for simulating and testing a LPSE. Thistester may generate such inputs to a LPSE that outputs of the LPSE areeasy to predict. The predicted outputs may then be compared with theactual outputs computed by the LPSE. Moreover, the inputs generated bythe tester to the LPSE may look almost like arbitrary (nearly random)inputs, quite similar to those actual inputs which are applied to a LPSEin real chip practice.

In an exemplary aspect of the present invention, the tester may includea longest prefix search engine, an inputs generator for providing anearly random flow of input commands to the longest prefix search engineand for outputting a floating rectangle which may represent a searchtable of the longest prefix search engine, a coding module for providingaddress and prefix information to the longest prefix search engine, amapping module for providing data information to the longest prefixsearch engine, a super search engine for performing super searchoperations, and an analyzer for computing predicted outputs of thelongest prefix search engine and for comparing the predicted outputswith actual outputs computed by the longest prefix search engine.

It is to be understood that both the foregoing general description andthe following detailed description are exemplary and explanatory onlyand are not restrictive of the invention as claimed. The accompanyingdrawings, which are incorporated in and constitute a part of thespecification, illustrate an embodiment of the invention and togetherwith the general description, serve to explain the principles of theinvention.

BRIEF DESCRIPTION OF THE DRAWINGS

The numerous advantages of the present invention may be betterunderstood by those skilled in the art by reference to the accompanyingfigures in which:

FIG. 1 is an exemplary embodiment of a sequential tester for a longestprefix search engine in accordance with the present invention, whereinmain modules of the sequential tester are shown; and

FIG. 2 depicts an exemplary embodiment of the longest prefix searchengine shown in FIG. 1 in accordance with the present invention.

DETAILED DESCRIPTION OF THE INVENTION

Reference will now be made in detail to the presently preferredembodiments of the invention, examples of which are illustrated in theaccompanying drawings.

Referring generally now to FIGS. 1 and 2, exemplary embodiments of thepresent invention are shown. A purpose of the present invention is tocreate a sequential tester which may be used to simulate and analyzesequential behavior of LPSEs and to perform their functional testing.

In synthesis practice of VLSI designs the verification and testingproblems play a major role at final stages of development and designing.Special difficulty may lie in the testing of netlists and chips withcomplex sequential behavior (functioning), such as those found in searchengines of different natures (see, for instance, co-pending U.S. patentapplication Ser. No. 09/678,313).

One of the practical methods to prove that search engines may functionwell in real chip practice is to perform their all-round verification bymeans of sequential testers that simulate actual usage of such searchengines.

LPSEs may be more difficult for simulation and testing than searchengines for perfect match type, because for LPSEs one need simulateengine commands dealing with address prefixes of an arbitrary lengthrather than addresses of a fixed length. Moreover, LPSEs requireparticular encoding/decoding of engine internal memory, which may besignificantly different from what was described in co-pending U.S.patent application Ser. No. 10/135,624, which describes built-in testersfor search engines for perfect match type.

An exemplary sequential and functional tester in accordance with thepresent invention may be employed for simulating and testing searchengines with possibility of longest prefix searches. This tester maygenerate such inputs to a LPSE that outputs of the LPSE are easy topredict. The predicted outputs may then be compared with the actualoutputs computed by the LPSE. Moreover, the inputs generated by thetester to the LPSE may look almost like arbitrary inputs, quite similarto those actual inputs which are applied to a LPSE in real chippractice.

The tester of the present invention may have the following features: (1)the tester may be a built-in feature of a LPSE; (2) the tester may worksequentially as a sequential finite machine; (3) the tester may testfunctions which are performed on a LPSE; (4) the tester may be of smallsize; (5) the tester may simulate almost all possible behavior of aLPSE; and (6) the user may set up a desirable flow of input commands anddata to be tested.

It should be noted that a C/C++ model of the tester according to thepresent invention may also be used as an external tester or inco-modeling testing of LPSEs. For instance, the model may be used aspart of co-modeling testing of search engines with IKOS V-Station orsimilar.

Referring to FIG. 1, an exemplary embodiment of a sequential tester 100for LPSEs in accordance with the present invention is shown. Thesequential tester 100 may include an Inputs Generator module 102, aSuper Search module 104, a COD module (encoding module) 106, a F module(mapping module) 108, the LPSE module 110, and an Analyzer module 112.

FIG. 2 shows an exemplary embodiment of the LPSE 110 in accordance withthe present invention. The LPSE 110 may have four input ports: a COMport 202 for inputting commands, an ADDR port 204 for inputtingaddresses, a PREF port 206 for inputting address prefixes, and a DI port208 for inputting data. In addition, the LPSE 110 may have four outputports: an ENG_STAT port 210 for outputting the current engine status, aCOM_STAT port 212 for outputting the current status of a command, aPREF_OUT port 214 for outputting the actual prefix length, and a DO port216 for outputting actual data.

LPSE and its Functionality

The LPSE 110 is a functional module for searching and editing (insertingand deleting) entries. Each entry in a search engine may be in the form((addr, pref), data_in), wherein (addr, pref) determines addr_pref thatrepresents an address (address prefix) in Search Table, and data_inrepresents the data associated with the addr_pref. For a given addressaddr that arrives at the port ADDR 204, the parameter pref that arrivesat the port PREF 206 may determine the length of the address prefixaddr_pref, which may be stored with associated data data_in that arrivesto the port DI 208 in engine Search Table. For example, for an entrywith addr=(1001111010), the parameter pref=5=(0101) determinesaddr_pref=(10011), which is the first 5 bits of addr from its left side,and the parameter pref=3=(0011) determines addr_pref=(100), which is thefirst 3 bits of addr from its left side. Thus, in Search Table entriesin the form (addr_pref, data) may be stored.

Input commands may include SEARCH, NEXT, INSERT and DELETE. INSERT andDELETE are editing commands, and SEARCH and NEXT are search commands.Commands arrive at the port COM 202.

LPSE commands may have latency equal to command_latency, which meanscompleted commands may output in command_latency clock cycles aftercommands start.

The INSERT command may be performed only when the current engine statuseng_stat (at the output port ENG_STAT 210) is “Ready to Insert orDelete” (“ready” state). When the current engine status is at a “ready”state, the LPSE 110 may search its Search Table for an entry at theaddress addr_pref. If such an entry (addr_pref, some_dat) is found, theLPSE 110 may first write the updated entry (addr_pref, data_in) intoSearch Table and then output com_stat “Already exist” at the portCOM_STAT 212 and output data_out=some_dat at time (t+command_latency) atthe port DO 216. If no entry is found in Search Table at the addressaddr_pref, the LPSE 110 may write into Search Table (if Search Table isnot full at the moment) a new entry (addr_pref, data_in) and at time(t+command_latency) output com_stat “Insert successful” anddata_out=data_in.

The DELETE command may be performed in a similar way to the INSERTcommand. If an entry (addr_pref, some_dat) already exists at the addressaddr_pref in Search Table, the LPSE 110 may first delete the entry fromthe memory and then output com_stat “Delete successful” anddata_out=some_dat. Otherwise, com_stat may be set to “Entry not found”and data_out=0 at time (t+command_latency).

For both editing commands, the LPSE 110 may go to the next “Ready toInsert or Delete” status at a nondeterministic time.

The SEARCH command searches the engine memory for data written at theinput address addr_pref and may be performed without regard to thecurrent engine status. If an entry (addr_pref, some_dat) exists at theaddress address_pref in Search Table, then at time (t+command_latency)com_stat will be set to “Match is perfect” and data_out may outputsome_dat. If no entry exist at the given address prefix addr_pref, butinstead an entry (shorter_addr_pref, some_other_dat) exists at theaddress shorter_addr_pref in memory, where shorter_addr_prefix is itselfa prefix of the original addr_pref, then at time (t+command_latency)com_stat may be set to “Longest Prefix Math Match” and data_out mayoutput some_other_dat associated with the longest possibleshorter_addr_pref found in Search Table. Otherwise, if no entry withshorter address prefix exists in engine memory, com_stat may be set to“No Match” and data_out=0 at time (t+command_latency).

A NEXT command may be performed any number of times after SEARCHcommand. Each time a NEXT command may search for a shorter addressprefix in the memory, output com_stat “Next Match found” and data_outequal to data associated with the shorter address prefix found, and alsooutput the actual prefix length (at the output port PREF_OUT 214). Inthe case when no more shorter address prefix exist, the LPSE 110 mayoutput com_stat “No Next Match” and data_out=0 at time(t+command_latency).

Search commands (SEARCH or NEXT) may be performed without regard to thecurrent engine status of the LPSE 110.

When the engine status is “Ready to Insert or Delete” at the time t, theLPSE 110 may accept either search (SEARCH or NEXT) or edit (INSERT orDELETE) command at the same time t. In the case of either searchcommand, the LPSE 110 may be again ready to accept a next search orINSERT or DELETE command in the next clock cycle. In the case of anaccepted INSERT or DELETE command, the LPSE 110 may go to “Not Ready toInsert or Delete” (“busy” state) and may stay in the “busy” state forsome time.

When the engine status is “Not Ready to Insert or Delete”, then anyarriving edit commands may be ignored.

The LPSE 110 may output (update) a (Ready or Not to Insert or Delete)bit of the engine status at next moment and an eng_stat bit (Memory Fullor Not) after latency_delay moments of time. When the engine memory isfull, INSERT command may be ignored.

An example of search engine implementation and more details about theconstruction and functionality may be found in co-pending U.S. patentapplication Ser. No. 09/678,313.

Generating Sequential Test

Examples of generating test trajectories may be provided below.Trajectories are generated by the tester 100. After decoding, thetrajectories may look quite random from the standpoint of the LPSE 110,but may be easily analyzed, verified and tested from the standpoint ofthe tester 100 itself.

Encoding and Decoding of LPSE Address Space

One of the key tester constructions of the present invention is a torusTor and encoding/decoding of the address space of the LPSE 110 by meansof the torus and the points of the torus.

Let n=2 k−1 be the address length for some integer k. Note in the caseof an even address length, a dummy bit may be inserted in the middle ofthe address when performing encoding, and the dummy bit may be deletedwhen performing decoding. One may define tor_a=2^(k)−1 and tor_b=2^(k)+1and consider further two sets of numbers T_a={0, 1, . . . tor_a−1} andT_b={0,1, . . . , tor_b−1}, i.e. sets of residues by modulo tor_a andtor_b, respectively. Thus, the addition operation in T_a and T_b isperformed by modulo tor_a and tor_b, respectively.

Note that k-bit representations of all numbers from T_a may be a table(which may also be denoted T_a) of all binary vectors of the length k,excluding vector of all ones (1, . . . 1). Thus, (k+1)-bitrepresentations of all numbers from T_b may have the form (0,y), where yis an arbitrary k-bit vector, and in addition vector (1,0, . . . 0).This table may also be denoted T_b.

A torus Tor may be defined as Tor=T_a×T_b. Taking into account tablerepresentations of the sets T_a and T_b, an arbitrary point A from Tormay be represented in binary form (x, cy), where x is any vector fromT_a (i.e. arbitrary vector of the length k excluding (1, . . . 1)), c isa bit, (i.e. 0 or 1), and if c=0, then y may be any k_bit vector and ifc=1 then y=(0, . . . ,0). The point A may be associated with a 2 k-bitbinary vector P as follows: if c=0, then P=(x,y), otherwise P=(1, . . .1,x).

From these constructions it is clear that the torus points maycorrespond to all binary vectors of the length 2 k excluding vector (1,. . . ,1) and this correspondence is a one-to-one correspondence.

For a given vector P, one may, also in a one-to-one manner, extractaddr_pref as the part to the left side of the last “zero” bit of thevector P. For example, if k=3, n=5, then for P=(101101) one may getaddr_pref=1011 and pref=4, and for P=(010100) one may getaddr_pref=01010 and pref=5. Note that addr_pref may be allowed to beempty, e.g., for P=(011111) pref=0 may be obtained.

For a given address and prefix length pref, in order to decode addressone may first take address's pref bits (i.e. addr_pref), then add 0 andfill the rest bits with ones until a vector of 2 k-bit length may beobtained.

As shown in FIG. 1, the COD module 106 (or a DECOD module) may be usedto compute transformation (or inverse transformation) from a point A tothe address prefix addr_pref (or from addr_pref to a point A). Note thatthe DECOD module is not depicted in FIG. 1 but the DECOD module may beincluded in the Super Search module 104.

Search Table Representation

For LPSE Search Table representations, rectangular areas on torus Tormay be utilized, which may be quite similar to floating rectanglesdescribed in co-pending U.S. patent application Ser. No. 10/135,624. Themain difference is in that here one may define Tor=T_a×T_b and thus thevector operation of additions with points from Tor is performed bymodulo tor_a for their first coordinates and by modulo tor_b for thesecond coordinates.

A floating rectangle R is a rectangle grid of integers and may includetwo incomplete lines, such as the one adjusting to the left or to thetop of the rectangle (for insertion of new points) and the otheradjusting to the right or to the bottom of the rectangle (for deletionof existing points).

Insertion and deletion operations may be performed with the rectangle R.When an insertion operation is performed, a new point is added to therectangle R, chosen from the insertion line. If a complete line isobtained after insertion, then the line may be added to the rectangle R.If there is no insertion line to start with, then one may first choose anew insertion line from two adjusting sides, such as the one from thetop or the to the left of the rectangle R. Actual choice may bedetermined by a random bit.

When a deletion operation is performed, a point may be deleted from adeletion line. If a deletion line is not available, a new deletion linemay be chosen from two adjusting sides, such as the one from the rightside or the other from the bottom of the rectangle R. Again, the actualchoice may be determined by a random bit.

Besides the foregoing described insertion and deletion operations,search operations may also be performed such that for a given point adecision whether this point is or is not from the rectangle R may bemade. This may be easily computed when knowing corner points of therectangular R. Note that this operation does not change the rectangle R.

Finally, super search operations need also be performed in order to beready to perform a command NEXT that may arrive after a SEARCH command.For a given point P, let addr_pref and pref denotes what one may getafter encoding the point P. Now one may determine up to (addr_length+1)points P_(—)0, P_(—)1, . . . P_pref (P_pref coincide with P), and foreach of these points one may perform search operations and then save andhold the results in a binary vector S (see FIG. 1). This multiple searchmay be defined as a super search operation. The first pref bits of S(the rest are equal to 0) may indicate whether the point P_i belongs tothe rectangular or not, i=0, . . . , pref. Point P_i may be determinedas a prefix of the length i of addr_pref computed for P. For example, ifP=(101001), then addr_pref=1010 for pref=4 and one may getP_(—)0=(011111), P_(—)1=(101111), P_(—)2=(100111), P_(—)3=(101011) andfinally P_(—)4=P (101001).

Super search operations may be performed by the Super Search module 104(see FIG. 1), which may allow the tester 100 to simulate and computeLPSE outputs in the case of command NEXT.

According to an exemplary embodiment of the present invention, the workflow of the tester 100 may be arranged in such a way that a flow ofinput data and primary commands generated for the floating rectangular Rafter applying encoding procedures becomes a nearly random flow ofinputs and commands to the LPSE 110. Moreover, since LPSE Search Tablealways corresponds to the current floating rectangular, Search Table maybe easily available for analysis and comparison during the testing.

Random Flow of Primary Commands

Using an appropriate random bit generator, primary commands such ascom_search, com_search_inside, com_insert, com_insert_inside,com_delete, com_delete_outside, com_next, and the like may be generated(preferably one at a time) at the discrete moments of time t=0, 1, . . .according to a preset distribution of probability. These primarycommands may be used to test sequential and functional behavior of theLPSE 110.

A point A (see FIG. 1) from the torus Tor may be associated with each ofthese commands. For the command com_search, A may be chosen as a randompoint from Tor; for the commands com_search_inside andcom_insert_inside, A may be chosen as a random point from the currentrectangle; for the command com_delete_outside, A may be chosen as arandom point from outside of the current rectangle. The command com_nextmay be associated with the point of last command SEARCH. Note that thesecommands do not change the floating rectangle.

For command com_insert, an insertion operation may be applied to thecurrent rectangle R, and thus a point A may be inserted to the rectangleR. This point A may be associated with the given command com_insert.

In the case of command com_delete, a deletion operation may be appliedto the current rectangle R, and thus a point A may be deleted from therectangle R.

With an insertion or deletion operation being performed, a new rectangleR_new may be obtained at the same moment. Note that actual switchingfrom the rectangle R to the rectangle R_new may actually depend on theauxiliary flag “Ready”. If Ready=0, the old rectangle R may be leftthere without any change at the next moment of time. If Ready=1, then atthe next moment of time R_new may become the current rectangle. Flag“Ready” may be computed each moment from the engine status output(eng_stat) of the LPSE 110. That is, if eng_stat is “Ready to Insert orDelete”, then Ready=1, and if eng_stat is “Not Ready to Insert orDelete”, then Ready=0 (see FIG. 1).

The number of points in the rectangle may be denoted as a count. If acount reaches a maximal value equal to engine_capacity, the probabilitydistribution for primary commands may be automatically changed to forcethe rectangle to move to an empty state (i.e. count=0). When therectangle becomes empty, the probability distribution may again bechanged in order to force the rectangle to move to a full state (i.e.,count=engine_capacity). It should be noted that a more complex scenariomay be preset by establishing rules for probability changes and formanaging the flow of primary commands, as may be contemplated by anperson of ordinary skill in the art.

It is noteworthy that when count=0 or count=engine_capacity, flow ofprimary commands may be slightly modified. For example, whencount=engine_capacity, in order to avoid error a command com_insertgenerated may be changed to a command com_insert_inside. Similarly, whencount=0, a command com_delete generated may be changed to a commandcom_delete_outside. Associated points may be changed correspondingly.

LPSE Input Command and Data

Primary commands generated by an appropriate random bit generator may bere-denoted into LPSE commands in the module Inputs Generator 102 of thetester 100 (see FIG. 1). For example, commands com_search andcom_search_inside may become a simple LPSE command SEARCH; com_insertand com_insert_inside may become a LPSE command INSERT; com_delete andcom_delete_outside may become a LPSE command DELETE; command com_nextmay become LPSE command NEXT.

To compute the address and prefix length, the foregoing describedencoding procedure that embeds torus points into the address space ofLPSE may be used. Where A is a current point associated with a LPSEcommand, addr_pref and pref may be computed by means of the module COD106 of the tester 100 (see FIG. 1).

Input_data for the input DI of the LPSE 110 (see FIG. 1) may be computedby the mapping module F 108 that embeds a torus point into the inputdata space. It may be a deterministic mapping. It is appreciated that anon-zero input_data is needed only in the case of a LPSE command INSERT.

Background Computation and Comparison

By knowing a few parameters that describe the current floating rectangleR and by knowing input commands and input data, the LPSE behavior may beeasily simulated, and LPSE outputs except the engine status may becorrectly computed and predicted. Although the moment when the LPSEstatus changes from “busy” state to “ready” state may not be predictedwith the present invention, this is nonessential for testing because theLPSE status change is used only to switch from the current rectangle tothe new one when an arrived editing command is accepted by the LPSE.

All these foregoing described computations on torus may be preformed asa background computation, which may be performed in the module Analyzer112 of the tester 100, which may be communicatively coupled to theinputs generator 102, the super search 104, and the LPSE 110 (see FIG.1), to predict the outputs of the LPSE. The predicted LPSE outputscomputed by the module Analyzer 112 and the actual LPSE outputs computedby the LPSE 110 may then be compared during the test. This comparisonmay also be performed in the Analyzer 112.

It is understood that the specific order or hierarchy of steps in themethods disclosed are examples of exemplary approaches. Based upondesign preferences, it is understood that the specific order orhierarchy of steps in the method can be rearranged while remainingwithin the scope of the present invention. The accompanying methodclaims present elements of the various steps in a sample order, and arenot meant to be limited to the specific order or hierarchy presented.

It is believed that the present invention and many of its attendantadvantages will be understood by the foregoing description. It is alsobelieved that it will be apparent that various changes may be made inthe form, construction and arrangement of the components thereof withoutdeparting from the scope and spirit of the invention or withoutsacrificing all of its material advantages. The form herein beforedescribed being merely an explanatory embodiment thereof, it is theintention of the following claims to encompass and include such changes.

1. A method for simulating and testing sequential behavior of a longestprefix search engine, comprising: supplying a nearly random flow ofinput commands to a longest prefix search engine; encoding an addressspace of said longest prefix search engine using a torus and points ofsaid torus; generating said points which are associated with said inputcommands; generating a floating rectangle on said torus, said floatingrectangle representing a search table of said longest prefix searchengine; supplying address, prefix, and data information extracted fromsaid points to said longest prefix search engine as inputs; computingactual outputs of said longest prefix search engine; computing predictedoutputs of said longest prefix search engine; and comparing said actualoutputs and said predicted outputs.
 2. An apparatus for simulating andtesting sequential behavior of a longest prefix search engine,comprising: means for supplying a random flow of input commands to alongest prefix search engine; means for encoding an address space ofsaid longest prefix search engine using a torus and points of saidtorus; means for generating said points which are associated with saidinput commands; means for generating a floating rectangle on said torus,said floating rectangle representing a search table of said longestprefix search engine; means for supplying address, prefix, and datainformation extracted from said points to said longest prefix searchengine as inputs; and means for computing actual outputs of said longestprefix search engine; means for computing predicted outputs of saidlongest prefix search engine; and means for comparing said actualoutputs and said predicted outputs.